package com.wc.AlgoOJ_train.train1.c7.A714;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/11 12:49
 * @description 核反应堆
 * http://43.138.190.70:8888/p/A714
 */
public class Main {
    public static void main(String[] args) {
        long[][] dp = new long[34][2];
        dp[0][0] = 1;
        for (int i = 1; i < 34; i++) {
            dp[i][0] = 3 * dp[i - 1][0] + 2 * dp[i - 1][1];
            dp[i][1] = dp[i - 1][0] + dp[i - 1][1];
        }
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int n = sc.nextInt();
            if (n == -1) {
                return;
            }
            System.out.println(dp[n][0] + ", " + dp[n][1]);
        }
    }
}
